import 'package:oramemo/generated/json/base/json_convert_content.dart';
import 'package:oramemo/entity/voice_record_detail_entity.dart';

VoiceRecordDetailEntity $VoiceRecordDetailEntityFromJson(
    Map<String, dynamic> json) {
  final VoiceRecordDetailEntity voiceRecordDetailEntity = VoiceRecordDetailEntity();
  final String? msg = jsonConvert.convert<String>(json['msg']);
  if (msg != null) {
    voiceRecordDetailEntity.msg = msg;
  }
  final int? code = jsonConvert.convert<int>(json['code']);
  if (code != null) {
    voiceRecordDetailEntity.code = code;
  }
  final VoiceRecordDetailData? data = jsonConvert.convert<
      VoiceRecordDetailData>(json['data']);
  if (data != null) {
    voiceRecordDetailEntity.data = data;
  }
  return voiceRecordDetailEntity;
}

Map<String, dynamic> $VoiceRecordDetailEntityToJson(
    VoiceRecordDetailEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['msg'] = entity.msg;
  data['code'] = entity.code;
  data['data'] = entity.data?.toJson();
  return data;
}

extension VoiceRecordDetailEntityExtension on VoiceRecordDetailEntity {
  VoiceRecordDetailEntity copyWith({
    String? msg,
    int? code,
    VoiceRecordDetailData? data,
  }) {
    return VoiceRecordDetailEntity()
      ..msg = msg ?? this.msg
      ..code = code ?? this.code
      ..data = data ?? this.data;
  }
}

VoiceRecordDetailData $VoiceRecordDetailDataFromJson(
    Map<String, dynamic> json) {
  final VoiceRecordDetailData voiceRecordDetailData = VoiceRecordDetailData();
  final String? createTime = jsonConvert.convert<String>(json['createTime']);
  if (createTime != null) {
    voiceRecordDetailData.createTime = createTime;
  }
  final VoiceRecordDetailDataParams? params = jsonConvert.convert<
      VoiceRecordDetailDataParams>(json['params']);
  if (params != null) {
    voiceRecordDetailData.params = params;
  }
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    voiceRecordDetailData.id = id;
  }
  final int? deviceId = jsonConvert.convert<int>(json['deviceId']);
  if (deviceId != null) {
    voiceRecordDetailData.deviceId = deviceId;
  }
  final int? userId = jsonConvert.convert<int>(json['userId']);
  if (userId != null) {
    voiceRecordDetailData.userId = userId;
  }
  final int? voiceType = jsonConvert.convert<int>(json['voiceType']);
  if (voiceType != null) {
    voiceRecordDetailData.voiceType = voiceType;
  }
  final String? voicePath = jsonConvert.convert<String>(json['voicePath']);
  if (voicePath != null) {
    voiceRecordDetailData.voicePath = voicePath;
  }
  final String? voiceContent = jsonConvert.convert<String>(
      json['voiceContent']);
  if (voiceContent != null) {
    voiceRecordDetailData.voiceContent = voiceContent;
  }
  final String? voiceTransliterate = jsonConvert.convert<String>(
      json['voiceTransliterate']);
  if (voiceTransliterate != null) {
    voiceRecordDetailData.voiceTransliterate = voiceTransliterate;
  }
  final int? aiPlatform = jsonConvert.convert<int>(json['aiPlatform']);
  if (aiPlatform != null) {
    voiceRecordDetailData.aiPlatform = aiPlatform;
  }
  final int? voiceDuration = jsonConvert.convert<int>(json['voiceDuration']);
  if (voiceDuration != null) {
    voiceRecordDetailData.voiceDuration = voiceDuration;
  }
  final int? status = jsonConvert.convert<int>(json['status']);
  if (status != null) {
    voiceRecordDetailData.status = status;
  }
  final int? readStatus = jsonConvert.convert<int>(json['readStatus']);
  if (readStatus != null) {
    voiceRecordDetailData.readStatus = readStatus;
  }
  return voiceRecordDetailData;
}

Map<String, dynamic> $VoiceRecordDetailDataToJson(
    VoiceRecordDetailData entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['createTime'] = entity.createTime;
  data['params'] = entity.params?.toJson();
  data['id'] = entity.id;
  data['deviceId'] = entity.deviceId;
  data['userId'] = entity.userId;
  data['voiceType'] = entity.voiceType;
  data['voicePath'] = entity.voicePath;
  data['voiceContent'] = entity.voiceContent;
  data['voiceTransliterate'] = entity.voiceTransliterate;
  data['aiPlatform'] = entity.aiPlatform;
  data['voiceDuration'] = entity.voiceDuration;
  data['status'] = entity.status;
  data['readStatus'] = entity.readStatus;
  return data;
}

extension VoiceRecordDetailDataExtension on VoiceRecordDetailData {
  VoiceRecordDetailData copyWith({
    String? createTime,
    VoiceRecordDetailDataParams? params,
    int? id,
    int? deviceId,
    int? userId,
    int? voiceType,
    String? voicePath,
    String? voiceContent,
    String? voiceTransliterate,
    int? aiPlatform,
    int? voiceDuration,
    int? status,
    int? readStatus,
  }) {
    return VoiceRecordDetailData()
      ..createTime = createTime ?? this.createTime
      ..params = params ?? this.params
      ..id = id ?? this.id
      ..deviceId = deviceId ?? this.deviceId
      ..userId = userId ?? this.userId
      ..voiceType = voiceType ?? this.voiceType
      ..voicePath = voicePath ?? this.voicePath
      ..voiceContent = voiceContent ?? this.voiceContent
      ..voiceTransliterate = voiceTransliterate ?? this.voiceTransliterate
      ..aiPlatform = aiPlatform ?? this.aiPlatform
      ..voiceDuration = voiceDuration ?? this.voiceDuration
      ..status = status ?? this.status
      ..readStatus = readStatus ?? this.readStatus;
  }
}

VoiceRecordDetailDataParams $VoiceRecordDetailDataParamsFromJson(
    Map<String, dynamic> json) {
  final VoiceRecordDetailDataParams voiceRecordDetailDataParams = VoiceRecordDetailDataParams();
  return voiceRecordDetailDataParams;
}

Map<String, dynamic> $VoiceRecordDetailDataParamsToJson(
    VoiceRecordDetailDataParams entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  return data;
}

extension VoiceRecordDetailDataParamsExtension on VoiceRecordDetailDataParams {
}